#include "widget.h"
#include "ui_widget.h"
#include"QPushButton"
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    s=new student(this);
    t=new teacher(this);
    connect(t,&teacher::MySignal,s,&student::MySlot);
    QPushButton *button =new QPushButton(this);
    button->setText("点击上课");
    button ->resize(800,600);
    connect(button,&QPushButton::clicked,this,&Widget::emitmysignal);

}

Widget::~Widget()
{
    delete ui;
}

void Widget::emitmysignal()
{
    emit t->MySignal();
}

